#include<bits/stdc++.h>
using namespace std;
int rd(){
	int ans=0,f=1;char c=getchar();
	while(c<48||c>57){if(c=='-')f=-1;c=getchar();}
	while(c>47&&c<58)ans=(ans<<3)+(ans<<1)+(c^48),c=getchar();
	return ans*f;
}
#define f(a,b,c) for(int a=b;a<=c;++a)
#define F(a,b,c) for(int a=b;a>=c;--a)
#define int long long
int a[151515];
signed main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n=rd(),ans=n;
	f(i,1,n)a[i]=rd();
	sort(a+1,a+n+1);
	int L=1,R=1;// L: next monster to be eliminated, R: next monster to eliminate
	while(a[R]==a[L])++R;
	while(R<=n){
		// R eliminates L
		--ans;
		++L,++R;
		while(a[R]==a[L])++R;
	}
	cout<<ans;
	return 0;
}
/*
Ht6Yqrz5CQKoTwl9JiWTjacKRZqB8DdN6iwwXt0kJIYkFHrWzNzhyZzN9qZF1Ac7sW1QN18eIeOXvD1vZyaXXZseNPtOaUTSyVqMUw0maNHWaIP7ExcmWVOsuIGUmkvkFj4hg5UGQjky096E4iybDNR8fhaPRV7eDCMtFo9fXsdV1jk6Sifd36lilK5BnBp0L9tav1DRtqwsYgwyNZbQdL7NfAYQLLRgVIEOHRp8Gk1oOvmlTLA6gHRJPzklL9RoRgCh50pLiq76ktqDDyHtFjBcgtN12npRR08WyysgmzmWrah2Yxtle4OKxlMzW9Px9XS7VIlGFYk66S6fN0O14mL0Wfx2pMywuQ2NindxJO2Qo83B8RABCTBi98kwVgqN6siogMmximLUuOd1onC0GNiNTQHy58JB020eMka4WvWOK9P6ub68wmWQAlMFtgRsiPU2744b0azIjPOdySlvEFJM1fasLzk1OD3TH54Hf3ZMQxxNNhGbwZwvEWmYTUZrhbIzgMEKNogojeB7JRgF0a9C4tkXN
*/
